import axios from 'axios'

//请求相关 
const http = {

};
// http.userLogin=function(params){
//     return axios.post('/api/login',params).then(r=>r.data)


// }

// axios.interceptors.request.use(function (config) {
//     // Do something before request is sent
//     //window.localStorage.getItem("accessToken") 获取token的value
//     let token = window.sessionStorage.getItem("userToken")
//     if (token) {
//         //将token放到请求头发送给服务器,将tokenkey放在请求头中
//         config.headers.userToken = token;
//         //也可以这种写法
//         // config.headers['accessToken'] = Token;
//     }
//     return config;
// }, function (error) {
//     // Do something with request error
//     return Promise.reject(error);
// });
http.userLogin = params => axios.post("/api/buildAdmin/login", params).then(r => r.data)
http.userAdd = params => axios.post("/api/buildPeople/addPeople", params).then(r => r.data)
//人员管理input框
http.input1 = params => axios.post("/api/buildCompany/getCompanyList", params).then(r => r.data)
http.input2 = params => axios.post("/api/buildJob/getBuildJobList", params).then(r => r.data)
// 人员管理查询` 
http.search = params => axios.post("/api/buildJob/likeBuildPeopleList", params).then(r => r.data)
// 人员管理表格
http.rygl = params => axios.post("/api/buildPeople/getBuildPeopleList", params).then(r => r.data)


// 机械设备
http.system = params => axios.post("/api/buildEquipment/sel", params).then(r => r.data)

http.findDrug= params => axios.get('http://localhost/drug/findAllDrugs', params).then(r => r.data);


export default http